
<php> $cancomment = intval(CheckPermission('core_normal','feed_comment')); </php>
<volist name='data' id ='vl'>
	<php>
		$cancomment_old = empty($vl['app_row_id'])  ? 0 : 1;
	</php>
	<dl class="feed_list"  id ='feed{$vl.feed_id}' model-node='feed_list'>
	<dt class="face">
	<a href="{$vl['user_info']['space_url']}"><img src="{$vl['user_info']['avatar_small']}"  event-node="face_card" uid='{$vl['user_info']['uid']}'></a></dt>
	<dd class="content">
	<eq name='vl.is_del' value='0'>
	<p class="hd">{$vl.title}
	<volist name="vl['GroupData'][$vl['uid']]" id="v2">
        <img style="width:auto;height:auto;display:inline;cursor:pointer;" src="{$v2['user_group_icon_url']}" title="{$v2['user_group_name']}" />&nbsp;
    </volist>
	<php> if(in_array($vl['user_info']['uid'],$followUids)){</php>
	{:W('Remark',array('uid'=>$vl['user_info']['uid'],'remark'=>$remarkHash[$vl['user_info']['uid']],'showonly'=>1))}
	<php>}</php>
	<php>if(!empty($vl['body'])){</php><php>}</php>
	</p>
	<div class="contents clearfix">
		{$vl.body|format=true}
		<div></div>
	</div>
	
	<p class="info">
	<span class="right">
	<php>if(in_array('repost',$weibo_premission)):</php>
	<eq name='vl.actions.repost' value='true'>
	<php>if(CheckPermission('core_normal','feed_share')){</php>
	<php>
		$sid = !empty($vl['app_row_id'])? $vl['app_row_id'] : $vl['feed_id'];
		$cancomment_old = in_array($vl['type'],$cancomment_old_type) ? 1 : 0;
	</php>
	<a event-node="group_feed_share" href="javascript:void(0)" event-args='sid={$sid}&stable={$vl["app_row_table"]}&curtable=group_feed&curid={$vl["feed_id"]}&appname={$vl["app"]}&cancomment={$cancomment_old}&feedtype={$vl["type"]}&is_repost={$vl["is_repost"]}&gid={$gid}&initHTML='>{:L('PUBLIC_SHARE_STREAM')}<php> if($vl['repost_count']>0){</php>&nbsp;({$vl['repost_count']}) <php>}</php></a>
	<!-- <i class="vline">|</i> -->
	<php>}</php>
	</eq>
	<php>endif;</php>
	
<!-- 	<eq name='vl.actions.favor' value='true'>
		{:W('Collection',array('type'=>$type,'sid'=>$vl['feed_id'],'stable'=>'feed','sapp'=>$vl['app']))}
	</eq> -->

	<php>if(in_array('comment',$weibo_premission)):</php>
	<eq name='vl.actions.comment' value='true'>
		<i class="vline">|</i>
		<a event-node="group_comment" href="javascript:void(0)" event-args='gid={$gid}&row_id={$vl.feed_id}&app_uid={$vl.uid}&app_row_id={$vl.app_row_id}&app_row_table={$vl.app_row_table}&to_comment_id=0&to_uid=0&app_name={$vl.app}&table=group_feed&cancomment={$cancomment}&cancomment_old={$cancomment_old}'>{:L('PUBLIC_STREAM_COMMENT')}<neq name='vl.comment_count' value='0'> ({$vl.comment_count}) </neq></a>
	</eq>
	<php>endif;</php>

	</span>
     <span>
	<a class="date" date="{$vl.publish_time}" href="{:U('group/Group/detail',array('feed_id'=>$vl['feed_id'],'uid'=>$vl['uid'],'gid'=>$gid))}">{$vl.publish_time|friendlyDate}</a>
	<span>{$vl['from']}</span>
	
	<em class="hover">
	<eq name='vl.actions.delete' value='true'>
	<!-- 做普通删除权限 和 管理删除权限 判断 & 只有分享可以被删除  -->
	<php>if(($vl['user_info']['uid'] == $GLOBALS['ts']['mid'] && CheckPermission('core_normal','feed_del')) || CheckPermission('core_admin','feed_del')){</php>
		<a href="javascript:void(0)" event-node ='group_delFeed' event-args='gid={$gid}&feed_id={$vl.feed_id}&uid={$vl.user_info.uid}'>{:L('PUBLIC_STREAM_DELETE')}</a>
	<php>}</php>
	</eq>
<!-- 	<php>if($vl['user_info']['uid'] != $GLOBALS['ts']['mid']){</php>
	<php>if(CheckPermission('core_normal','feed_report')){</php>
	<a href="javascript:void(0)" event-node='denounce' event-args='aid={$vl.feed_id}&type=feed&uid={$vl.user_info.uid}'>{:L('PUBLIC_STREAM_REPORT')}</a>
	<php>}</php>
	<php>}</php> -->
	</em>
    </span>
</p>
	   <div model-node="comment_detail" class="repeat clearfix" style="display:none;"></div>
 	
 	<else />
	
	<p>{:L('PUBLIC_INFO_ALREADY_DELETE_TIPS')}</p>
	<p class="info">
		<eq name='vl.actions.favor' value='true'>
		{:W('Collection',array('type'=>$type,'sid'=>$vl['feed_id'],'stable'=>'feed','sapp'=>$vl['app']))}
	</eq>
	</p>
	</eq> 
	   
	</dd>
	</dl>
</volist>
<script>
function doHighlight(a,b){
    highlightStartTag="<span style='color:red'>";
    highlightEndTag="</span>";
    var c="";
    var i=-1;
    var d=b.toLowerCase();
    var e=a.toLowerCase();
    while(a.length>0){
        i=e.indexOf(d,i+1);
        if(i<0){
            c+=a;
            a="";
        }else{
            if(a.lastIndexOf(">",i)>=a.lastIndexOf("<",i)){
                if(e.lastIndexOf("/script>",i)>=e.lastIndexOf("<script",i)){
                    c+=a.substring(0,i)+highlightStartTag+a.substr(i,b.length)+highlightEndTag;
                    a=a.substr(i+b.length);e=a.toLowerCase();
                    i=-1;
                }
            }
        }
    }
    return c;
};

$.fn.highlight=function(z){
    $(this).each(
        function(){
        	if (z !== null) {
            	$(this).html(doHighlight($(this).html(),z))
        	}
        });
    return this;
}

$(document).ready(function(){
if(!'{$topic_id}' && '{$feed_key}'){
	var key3 = '{$feed_key}';
    //for(one in key3){
        $('.contents').highlight(key3);
        //$('.ask_title').highlight(key3[one]);
    //}
}
});
/**
 * 时间更新效果
 * return void
 */
$(document).ready(function() {
	var wTime = parseInt("{:time()}");
	var updateTime = function()
	{
		$('.date').each(function(i, n) {
			var date = $(this).attr('date');
			if(typeof date !== 'undefined' && typeof core.weibo !== 'undefined') {
				$(this).html(core.weibo.friendlyDate(date, wTime));
			}
		});	
	};
	updateTime();
	setInterval(function() {
		wTime += 10;
		updateTime();
	}, 10000);
});
</script>